package com.manbu.live.api.controller;

import com.manbu.live.user.dto.UserDTO;
import com.manbu.live.user.inerface.IUserRpc;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.*;

/**
 * @author hanWang
 * @Title:
 * @Package
 * @Description:
 * @date 2024/1/87:56 上午
 */
@RestController
@RequestMapping("/test")
public class TestController {
    // 远程rpc 引入
    @DubboReference
    private IUserRpc iUserRpc;

    @GetMapping("/dubbo")
    public String dubboTest(){

        return iUserRpc.test();
    }

    @PostMapping("/getByUserId")
    public UserDTO getByUserId(@RequestParam("userId") Long userId){

        return iUserRpc.getByUserId(userId);
    }
}
